
import java.math.BigInteger;


public class e048 {
    public static void main(String[] args) {
        long sTime = System.currentTimeMillis();
        BigInteger e = BigInteger.ONE;
        BigInteger sum = BigInteger.ZERO;
        for (int i = 1; i <= 1000; i++) {
            BigInteger b = e.pow(i);
            sum = sum.add(b);
            e = new BigInteger(String.valueOf(i+1));
        }
        String l = sum.toString();
        StringBuilder b = new StringBuilder(10);
        int j = l.length() - 11;
        for (int i = l.length() - 1;  i > j; i--) {
            b.append(l.charAt(i));
        }
        b.reverse();
        System.out.println(b);
        long fTime = System.currentTimeMillis();
        System.out.println("Time: " + (fTime - sTime) + "ms");
    }
}